<?php
/**
 * Set the routes. Each route must have a minimum of a name, a URI and a set of
 * defaults for the URI.
 */
Route::set('CPS', 'CPS(/<action>(/<param1>(/<param2>(/<param3>(/<other>)))))')
	->defaults(array(
		'directory'  => 'admin',
		'controller' => 'CPS',
        'action'     => 'index',
	));

Route::set('CPC', 'CPC(/<action>(/<param1>(/<param2>(/<param3>(/<other>)))))')
	->defaults(array(
		'directory'  => 'admin',
		'controller' => 'CPC',
        'action'     => 'index',
	));

Route::set('MM', 'mm(/<action>(/<param1>(/<param2>(/<param3>(/<other>)))))')
	->defaults(array(
		'directory'  => 'admin',
		'controller' => 'mm',
        'action'     => 'orders',
	));


Route::set('api', 'api/<controller>(/<action>(/<param1>(/<param2>)))')
	->defaults(array(
		'directory'  => 'api',
        'action'     => 'index',
	));

Route::set('report', 'machine(/<action>(/<param1>(/<param2>)))')
	->defaults(array(
		'controller' => 'machine',
        	'action'     => 'report',
	));

Route::set('account', 'account(/<action>(/<param1>(/<param2>)))')
	->defaults(array(
		'controller' => 'account',
        	'action'     => 'index',
	));

Route::set('account', 'account(/<action>(/<param1>(/<param2>)))')
	->defaults(array(
		'controller' => 'account',
        'action'     => 'index',
	));
Route::set('cppa', 'cppa(/<action>(/<param1>(/<param2>)))')
	->defaults(array(
		'controller' => 'cppa',
        	'action'     => 'report',
	));





Route::set('share', 'share/<message>', array('message' => '(.+)'))
	->defaults(array(
		'controller' => 'share',
		'action'     => 'index',
	));


Route::set('about', 'about(/<message>)', array('message' => '(.+)'))
	->defaults(array(
		'controller' => 'help',
		'action'     => 'detail',
		'param1'     => '3',
	));

Route::set('register', 'register(/<message>)', array('message' => '(.+)'))
	->defaults(array(
		'controller' => 'passport',
		'action'     => 'register',
	));

Route::set('login', 'login(/<message>)', array('message' => '(.+)'))
	->defaults(array(
		'controller' => 'passport',
		'action'     => 'login',
	));

Route::set('logout', 'logout(/<message>)', array('message' => '(.+)'))
	->defaults(array(
		'controller' => 'passport',
		'action'     => 'logout',
	));

Route::set('subscribe', 'subscribe/<type>/<args>', array('args' => '(.+)'))
	->defaults(array(
		'controller' => 'welcome',
		'action'     => 'subscribe',
	));

Route::set('my', 'my(/<controller>(/<action>(/<param1>(/<param2>))))')
	->defaults(array(
		'controller' => 'welcome',
		'action'     => 'index',
		'directory'  => 'my',
	));

Route::set('test', 'test(/<controller>(/<action>(/<param1>(/<param2>))))')
	->defaults(array(
		'controller' => 'test',
        'directory'  => 'test',
		'action'     => 'initcppa',
	));

Route::set('excel', 'excel/(<action>(/<param1>(/<param2>)))')
	->defaults(array(
		'controller' => 'excel',
		'action'     => 'index',
	));



Route::set('callback', 'callback(/<controller>(/<action>(/<param1>(/<param2>))))')
	->defaults(array(
		'controller' => 'welcome',
		'action'     => 'index',
		'directory'  => 'callback',
	));

Route::set('error', 'error/<action>/<message>', array('action' => '([0-9]+)', 'message' => '(.+)'))
	->defaults(array(
		'controller' => 'error',
	));

if (user::passport() == 'lenovo@lenovo.com')
{
    Route::set('demo', 'effect(/<action>(/<param1>(/<param2>(/<param3>))))')
	    ->defaults(array(
		'controller' => 'demo',
		'action'     => 'index',
	));
}

Route::set('public', 'public(/<controller>(/<action>(/<param1>(/<param2>))))')
	->defaults(array(
		'controller' => 'monitor',
		'action'     => 'payment',
		'directory'  => 'public',
	));

Route::set('weixin', 'weixin(/<action>(/<param1>(/<param2>)))')
	->defaults(array(
		'controller' => 'weixin',
		'action'     => 'index',
	));



Route::set('default', '(<controller>(/<action>(/<param1>(/<param2>(/<param3>(/<other>))))))', array('other' => '(.+)'))
	->defaults(array(
		'controller' => 'data',
		'action'     => 'index',
	));
